package num27;

/**
 * @author : DuJiabao
 * @Date : 2021/1/22 11:16
 * @Project : sword-finger-offer
 * @File : null.java
 * @Desc :请完成一个函数，输入一个二叉树，该函数输出它的镜像
 * https://leetcode-cn.com/problems/er-cha-shu-de-jing-xiang-lcof/
 */
public class Solution {
    public TreeNode mirrorTree(TreeNode root) {
        if(root == null) return null;
        TreeNode temp = root.right;
        root.right = mirrorTree(root.left);
        root.left = mirrorTree(temp);
        return root;
    }
}
